package dashboard

import (
	"gitee.com/yangguoliang001/go-gin-vue3/services/dashboardService"
	"github.com/gin-gonic/gin"
	"github.com/go-redis/redis/v7"
	"gorm.io/gorm"

	"go.uber.org/zap"
)

type Controller interface {
	QueryDashboardInfo(c *gin.Context)
}

type dashboardController struct {
	logger           *zap.Logger
	cache            *redis.Client
	dashboardService dashboardService.DashboardService
}

//
var _ Controller = (*dashboardController)(nil)

func New(logger *zap.Logger, db *gorm.DB, cache *redis.Client) Controller {
	return &dashboardController{
		logger:           logger,
		cache:            cache,
		dashboardService: dashboardService.New(cache, db),
	}
}
